﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ad="clr-namespace:AvalonDock"
    >


    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/AvalonDock;component/Resources/Brushes.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    
    
    <!--<ad:FindResourcePathConverter x:Key="resourcePathConverter"/>-->

    <ContextMenu
		     x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:ContextMenuElement.FloatingWindow}}">
        <MenuItem Command="ad:FloatingWindow.SetAsFloatingWindowCommand"/>
        <MenuItem Command="ad:FloatingWindow.SetAsDockableWindowCommand"/>
        <MenuItem Command="ad:FloatingWindow.TabbedDocumentCommand"/>
        <MenuItem Command="ad:FloatingWindow.CloseCommand"/>
    </ContextMenu>

    <Style TargetType="{x:Type ad:ResizingPanelSplitter}">
        <Setter Property="Background" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DefaultBackgroundBrush}}}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ad:ResizingPanelSplitter}">
                    <Grid>
                        <Border Background="{TemplateBinding Background}"/>
                        <Border Name="intBorder" Background="Transparent"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Orientation" Value="Horizontal">
                            <Setter Value="SizeWE" Property="Cursor" TargetName="intBorder"/>
                        </Trigger>
                        <Trigger Property="Orientation" Value="Vertical">
                            <Setter Value="SizeNS" Property="Cursor" TargetName="intBorder"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="PaneHeaderCommandStyle" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border 
						x:Name="PaneHeaderCommandIntBorder" 
						Background="Transparent"
						BorderThickness="1"
						Margin="0"
						Opacity="0.8">
                        <ContentPresenter ContentSource="Content"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" 
								TargetName="PaneHeaderCommandIntBorder"
								Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBorderBrush}}}"/>
                            <Setter Property="Background" 
								TargetName="PaneHeaderCommandIntBorder"
								Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBackground}}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="PaneHeaderContextMenuCommandStyle" 
           TargetType="{x:Type Button}" 
           BasedOn="{StaticResource PaneHeaderCommandStyle}">
        <Style.Triggers>
            <DataTrigger Value="True">
                <DataTrigger.Binding>
                    <Binding>
                        <Binding.RelativeSource>
                            <RelativeSource
                              Mode="FindAncestor"
                              AncestorType="{x:Type ad:DockablePane}"
                            />
                        </Binding.RelativeSource>
                        <Binding.Path>
                            IsOptionsMenuOpened
                        </Binding.Path>
                    </Binding>
                </DataTrigger.Binding>
                <Setter Property="Border.BorderBrush" 
								Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBorderBrush}}}"/>
                <Setter Property="Border.Background" 
								Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBackground}}}"/>
            </DataTrigger>

        </Style.Triggers>
   </Style>

    

    
</ResourceDictionary>